package com.tanhua.manager.job;

import cn.hutool.core.date.DateTime;
import com.tanhua.manager.service.AnalysisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class AnalysisJob {
    @Autowired
    private AnalysisService analysisService;
    @Scheduled(cron = "0 0/30 * * * ?")
    public void  analysis(){
        System.out.println("开始统计，当前时间是："+new DateTime().toString("yyyy-MM-dd HH:mm:ss")+"==");
        analysisService.analysis();
        System.out.println("统计完成");
    }
}
